# Main R Script
# load libraries
# run this only the first time you are running the code
# renv::restore()
library(here)
set.seed(8401)
# Defining all the folders
dirs <- c(
here("data-raw", "source"), # Data Cleaning Scripts (optional)
here("analysis") # Data Analysis scripts
)
# helper to source every .R/.r file in a directory
# this will run the scripts in the right order starting with data-raw and
# then the analysis scripts
source_all <- function(dir) {
scripts <- list.files(
path       = dir,
pattern    = "\\.[Rr]$",
full.names = TRUE
)
invisible(lapply(scripts, source))
}
# Source all the scripts listed
invisible(lapply(dirs, source_all))
renv::restore()
library(here)
renv::status()
renv::restore()
library(here)
set.seed(8401)
# Defining all the folders
dirs <- c(
here("data-raw", "source"), # Data Cleaning Scripts (optional)
here("analysis") # Data Analysis scripts
)
# helper to source every .R/.r file in a directory
# this will run the scripts in the right order starting with data-raw and
# then the analysis scripts
source_all <- function(dir) {
scripts <- list.files(
path       = dir,
pattern    = "\\.[Rr]$",
full.names = TRUE
)
invisible(lapply(scripts, source))
}
# Source all the scripts listed
invisible(lapply(dirs, source_all))
library(here)
set.seed(8401)
# Defining all the folders
dirs <- c(
here("data-raw", "source"), # Data Cleaning Scripts (optional)
here("analysis") # Data Analysis scripts
)
# helper to source every .R/.r file in a directory
# this will run the scripts in the right order starting with data-raw and
# then the analysis scripts
source_all <- function(dir) {
scripts <- list.files(
path       = dir,
pattern    = "\\.[Rr]$",
full.names = TRUE
)
invisible(lapply(scripts, source))
}
# Source all the scripts listed
invisible(lapply(dirs, source_all))
library(here)
set.seed(8401)
# Defining all the folders
dirs <- c(
here("data-raw", "source"), # Data Cleaning Scripts (optional)
here("analysis") # Data Analysis scripts
)
# helper to source every .R/.r file in a directory
# this will run the scripts in the right order starting with data-raw and
# then the analysis scripts
source_all <- function(dir) {
scripts <- list.files(
path       = dir,
pattern    = "\\.[Rr]$",
full.names = TRUE
)
invisible(lapply(scripts, source))
}
# Source all the scripts listed
invisible(lapply(dirs, source_all))
library(here)
set.seed(8401)
# Defining all the folders
dirs <- c(
here("data-raw", "source"), # Data Cleaning Scripts (optional)
here("analysis") # Data Analysis scripts
)
# helper to source every .R/.r file in a directory
# this will run the scripts in the right order starting with data-raw and
# then the analysis scripts
source_all <- function(dir) {
scripts <- list.files(
path       = dir,
pattern    = "\\.[Rr]$",
full.names = TRUE
)
invisible(lapply(scripts, source))
}
# Source all the scripts listed
invisible(lapply(dirs, source_all))
install.packages("stargazer")
library(stargazer)
library(here)
library(stargazer)
set.seed(8401)
# Defining all the folders
dirs <- c(
here("data-raw", "source"), # Data Cleaning Scripts (optional)
here("analysis") # Data Analysis scripts
)
# helper to source every .R/.r file in a directory
# this will run the scripts in the right order starting with data-raw and
# then the analysis scripts
source_all <- function(dir) {
scripts <- list.files(
path       = dir,
pattern    = "\\.[Rr]$",
full.names = TRUE
)
invisible(lapply(scripts, source))
}
# Source all the scripts listed
invisible(lapply(dirs, source_all))
renv::snapshot()
renv::snapshot()
